<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- v-on点击事件 -->
        <input type="button" value="提交" v-on:click='btn'>
        <!-- 简写点击事件@click -->
        <input type="button" value="提交" @click='btn'>
        <!-- 双击按钮dnlclick -->
        <input type="button" value="双击事件" @dblclick='btn'>
        <h2 @click='changfood'>{{food}}</h2>
        <h2 @click='changfood'>{{food}}</h2>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                food: 'qing'
            },
            methods: {
                btn: function() {
                    alert(123)
                },
                changfood: function() {
                    this.food += 'qi'
                }
            }
        })
    </script>
</body>

</html>